Skip to content

ref: Remove performance clear entry calls - #2490

Merged
HazAT merged 4 commits into
masterfrom
apm/resource-buffer
Mar 12, 2020
Merged

ref: Remove performance clear entry calls#2490
HazAT merged 4 commits into
masterfrom
apm/resource-buffer

Conversation

@HazAT

@HazAT HazAT commented Mar 12, 2020

Copy link
Copy Markdown
Member

User code or other libraries may be using the performance entries, therefore we do not clear entries.

Note: there is a limit on the number of "resource timing" entries, we do not change that, leaving it up to the browser default.

@HazAT
HazAT requested a review from rhcarvalho March 12, 2020 07:49
@HazAT
HazAT requested a review from kamilogorek as a code owner March 12, 2020 07:49
@HazAT HazAT self-assigned this Mar 12, 2020
@getsentry-bot

getsentry-bot commented Mar 12, 2020

Copy link
Copy Markdown
Contributor
Messages
📖

@sentry/browser bundle gzip'ed minified size: (ES5: 16.876 kB) (ES6: 15.9102 kB)

📖 ✅ TSLint passed

Generated by 🚫 dangerJS against 538b60c

@rhcarvalho rhcarvalho left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot guarantee that 300 is actually an increase. Specially not without looking at the number of entries.

Comment thread packages/apm/src/integrations/tracing.ts Outdated
Comment thread packages/apm/src/integrations/tracing.ts Outdated
Comment on lines -606 to -613
// The Performance object has a limited buffer size, often 150 entries. At some point the buffer may overflow, in
// which case we would not be able to use it to create/update spans. Therefore, after we have processed entries to
// report to Sentry, we clear the buffer in an attempt to allow for more entries to be added in the future.
// https://developer.mozilla.org/en-US/docs/Web/API/Performance
logger.log('[Tracing] Clearing most performance marks');
performance.clearMarks();
performance.clearMeasures();
performance.clearResourceTimings();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@HazAT HazAT changed the title ref: Use onresourcetimingbufferfull ref: Remove performance clear entry calls Mar 12, 2020

@dashed dashed left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍

@HazAT
HazAT merged commit b6dd2c7 into master Mar 12, 2020
@HazAT
HazAT deleted the apm/resource-buffer branch March 12, 2020 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants